#include<func.h>
int main(int argc,char*argv[])
{
    // ./test 192.168.213.128 1234 
    ARGS_CHECK(argc,3);
    int  sockfd = socket(AF_INET,SOCK_STREAM,0); //获取socket
    struct sockaddr_in addr;
    addr.sin_family = AF_INET;
    addr.sin_port = htons(atoi(argv[2]));
    addr.sin_addr.s_addr = inet_addr(argv[1]);
    int ret = connect(sockfd,(struct sockaddr*)&addr,sizeof(addr));
    //检查是否连接上
    ERROR_CHECK(ret,-1,"connect");
    ssize_t sret = send(sockfd,"helloworld\n",12,0);
    printf("sret = %ld\n",sret);
    return 0;
}